package org.unit.testmgmt.tml;

import java.util.Vector;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageFragment;

/**
 * Class for the unit-testmgmt-elements: project, package and class from the
 * base and test.
 * 
 * @author Robert Streng
 */
public class UTMElements {
	
	/**
	 * Constructor and methods.
	 * 
	 * @author Robert Streng
	 *
	 */
	public class UTMConstructorsAndMethods {
		private Vector<IMethod> baseClassMethods;
		private Vector<IMethod> baseClassConstructors;

		/**
		 * @return base class methods
		 */
		public Vector<IMethod> getBaseClassMethods() {
			return baseClassMethods;
		}

		/**
		 * @param baseClassMethods
		 */
		public void setBaseClassMethods(Vector<IMethod> baseClassMethods) {
			this.baseClassMethods = baseClassMethods;
		}

		/**
		 * @return base class constructors
		 */
		public Vector<IMethod> getBaseClassConstructors() {
			return baseClassConstructors;
		}

		/**
		 * @param baseClassConstructors
		 */
		public void setBaseClassConstructors(
				Vector<IMethod> baseClassConstructors) {
			this.baseClassConstructors = baseClassConstructors;
		}

	}

	/**
	 * Classes and packages.
	 * 
	 * @author Robert Streng
	 *
	 */
	public class UTMClassesAndPackages {
		private ICompilationUnit testBase = null;
		private String testBaseName = "";
		private ICompilationUnit testClass = null;
		private String testClassName = "";

		private IPackageFragment basePackage = null;
		private IPackageFragment testPackage = null;

		/**
		 * @return test base
		 */
		public ICompilationUnit getTestBase() {
			return testBase;
		}

		/**
		 * @param baseClass
		 */
		public void setTestBase(ICompilationUnit baseClass) {
			this.testBase = baseClass;
		}

		/**
		 * @return test class
		 */
		public ICompilationUnit getTestClass() {
			return testClass;
		}

		/**
		 * @param testClass
		 */
		public void setTestClass(ICompilationUnit testClass) {
			this.testClass = testClass;
		}

		/**
		 * @return base package
		 */
		public IPackageFragment getBasePackage() {
			return basePackage;
		}

		/**
		 * @param basePackage
		 */
		public void setBasePackage(IPackageFragment basePackage) {
			this.basePackage = basePackage;
		}

		/**
		 * @return test package
		 */
		public IPackageFragment getTestPackage() {
			return testPackage;
		}

		/**
		 * @param testPackage
		 */
		public void setTestPackage(IPackageFragment testPackage) {
			this.testPackage = testPackage;
		}

		/**
		 * @return test class name
		 */
		public String getTestClassName() {
			return testClassName;
		}

		/**
		 * @param testClassName
		 */
		public void setTestClassName(String testClassName) {
			this.testClassName = testClassName;
		}

		/**
		 * @return base class name
		 */
		public String getBaseClassName() {
			return testBaseName;
		}

		/**
		 * @param baseClassName
		 */
		public void setBaseClassName(String baseClassName) {
			this.testBaseName = baseClassName;
		}

	}

	/**
	 * Test project and the project of the test base.
	 * 
	 * @author Robert Streng
	 *
	 */
	public class UTMProjects {
		private IJavaProject testProject = null;
		private IJavaProject baseProject = null;
		private String testProjectName = "";

		private boolean isBaseProjectSelected = true;

		/**
		 * @return test project
		 */
		public IJavaProject getTestProject() {
			return testProject;
		}

		/**
		 * @param testProject
		 */
		public void setTestProject(IJavaProject testProject) {
			this.testProject = testProject;
		}

		/**
		 * @return base project
		 */
		public IJavaProject getBaseProject() {
			return baseProject;
		}

		/**
		 * @param baseProject
		 */
		public void setBaseProject(IJavaProject baseProject) {
			this.baseProject = baseProject;
		}

		/**
		 * @return true if base project is selected
		 */
		public boolean isBaseProjectSelected() {
			return isBaseProjectSelected;
		}

		/**
		 * @param isBaseProjectSelected
		 */
		public void setBaseProjectSelected(boolean isBaseProjectSelected) {
			this.isBaseProjectSelected = isBaseProjectSelected;
		}

		/**
		 * @return test project name
		 */
		public String getTestProjectName() {
			return testProjectName;
		}

		/**
		 * @param testProjectName
		 */
		public void setTestProjectName(String testProjectName) {
			this.testProjectName = testProjectName;
		}

	}

	private UTMProjects projects;
	private UTMClassesAndPackages classesAndPackages;
	private UTMConstructorsAndMethods constructorsAndMethods;

	/**
	 * @return the projects
	 */
	public UTMProjects getProjects() {
		return projects;
	}

	/**
	 * @param projects
	 */
	public void setProjects(UTMProjects projects) {
		this.projects = projects;
	}

	/**
	 * @return classes and packages
	 */
	public UTMClassesAndPackages getClassesAndPackages() {
		return classesAndPackages;
	}

	/**
	 * @param classesAndPackages
	 */
	public void setClassesAndPackages(UTMClassesAndPackages classesAndPackages) {
		this.classesAndPackages = classesAndPackages;
	}

	/**
	 * @return constructors and methods
	 */
	public UTMConstructorsAndMethods getConstructorsAndMethods() {
		return constructorsAndMethods;
	}

	/**
	 * @param constructorsAndMethods
	 */
	public void setConstructorsAndMethods(
			UTMConstructorsAndMethods constructorsAndMethods) {
		this.constructorsAndMethods = constructorsAndMethods;
	}

}
